##############################################################################################
# Dyadic Representation in the American North and South: The Case of Prohibition #############
# Michael P. Olson and James M. Snyder, Jr. ##################################################
# README File ################################################################################
# Full Replication Package ###################################################################
##############################################################################################

	This file details all data and scripts required to reproduce the analyses in "Dyadic 
	Representation in the American North and South: The Case of Prohibition" by Michael P.
	Olson and James M. Snyder, Jr. (Journal of Politics).

	To run all of the analysis, the replicator should begin with the "run_all_files.R" 
	script (in the "scripts" subfolder), set the top-level directory appropriate to their 
	computer, create a subfolder called "results" into which all results files will deposit,
	and run that script in R. That script will install and require necessary 
	packages and run the other scripts in the correct order. 

##############################################################################################
# Software ###################################################################################
##############################################################################################

	All analysis is undertaken in R (Version 3.6.2 "Dark and Stormy Night"). Additional 
	required packages are:
		- dplyr
		- foreign
		- ggplot2
		- haven
		- lfe
		- Matching
		- multiwayvcov
		- stringr
		- stargazer
		- tidyr
		- Hmisc
		- xtable
		- rowr

##############################################################################################
# Data Files #################################################################################
##############################################################################################

	- "alcohol_related_votes.dta"
		list of alcohol-related votes that we use

 	- "better_prohibition_rollcall_agdat.csv"
		district-level file for full period 1900-1935. 

	- "better_prohibition_rollcall_agdat_1910.csv"
		district-level file for period 1910-1920. 

	- "better_prohibition_rollcall_agdat_1910_timing.csv"
		district-level file for period 1910-1920. district preference measure
		based on pre-roll call referendums only. 

	- "better_prohibition_rollcall_agdat_legislator_1910.csv"
		legislator-level file for full period 1910-1920. 

	- "better_prohibition_rollcall_longdat_1910.csv"
		roll call-level file for period 1910-1920. 

	- "better_prohibition_rollcall_longdat_1910_timing.csv"
		roll call-level file for period 1910-1920. district preference measure
		based on pre-roll call referendums only. 

	- "better_prohibition_rollcall_agdat_1930.csv"
		district-level file for period 1928-1935. 

	- "better_prohibition_rollcall_agdat_1930_timing.csv"
		district-level file for period 1928-1935. district preference measure
		based on pre-roll call referendums only. 

	- "better_prohibition_rollcall_agdat_legislator_1930.csv"
		legislator-level file for period 1928-1935. 

	- "better_prohibition_rollcall_longdat_1930.csv"
		roll call-level file for full period 1928-1935. 

	- "better_prohibition_rollcall_longdat_1930_timing.csv"
		roll call-level file for period 1928-1935. district preference measure
		based on pre-roll call referendums only. 

	- "cong_primary_1910_1936.dta"
		primary election data for US house

	- "prohib_referendum_rolloff.dta"
		contains information on turnout for referendum elections and other 
		elections at a similar time

	- "prohib_votes_long_pretty.csv"
		referendum-level information at the county level. 

	- "seat_numbers.dta"
		data from Dubin (2006) on party seat shares in state legislatures.

	- "state_votes.csv"
		contains the assembled data on state legislative roll call votes on 18th amendment
		and district-level preferences for prohibition.

#############################################################################
# Code ######################################################################
#############################################################################
	
	"1.run_all_files.R"
		Installs and loads necessary packages and runs all other scripts in correct
		order. Start here and set working directory appropriately to replicate results.

	"2.prohibition_referenda_information.R"
		Neatens, and prints information about prohibition referenda, including 
		correlations across different categories.

	"3.cong_rollcall_table.R"
		Produces a table of the congressional roll call votes in our sample and generates
		summary stats for rolloff in referendums by region.

	"4.rollcall_prohibition_analysis.R"
		Produces congressional roll call voting analyses in text and supplementary materials.

	"5.state_votes_analysis.R"
		Outputs all state legislative results in the text and supplementary materials. 

	"6.primary_analysis.R"
		Assesses the relationship between a representative's congruence on prohibition and
		subsequent electoral success in primaries. 

	"7.multi_panel_table_function.R"
		Generates a regression table with multiple panels. A helper function.

